﻿<div>
    <div *ngIf="(pagesCount&& pagesCount > 2)" style="display:inline">
        <ul class="pagination pagination-sm">
            <li *ngIf="page != 0">
                <a (click)="search(0)">
                    <<</a>
            </li>
            <li *ngIf="page != 0">
                <a (click)="search(page-1)">
                    <</a>
            </li>
            <li *ngFor="let n of range" [ngClass]="{active: n == page}">
                <a (click)="search(n)" *ngIf="n != page">{{n+1}}</a>
                <span *ngIf="n == page">{{n+1}}</span>
            </li>
            <li *ngIf="page != pagesCount - 1"><a (click)="search(pagePlus(1))">></a></li>
            <li *ngIf="page != pagesCount - 1"><a (click)="search(pagesCount - 1)">>></a></li>
        </ul>
    </div>
</div>